/*
 * @Author: your name
 * @Date: 2021-02-02 15:47:04
 * @LastEditTime: 2021-02-24 23:55:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \myproject\src\api\user.js
 */

import request from '@/utils/request.js'
export const login = (data) => {
  return request({
    method: 'POST',
    url: '/v1_0/authorizations',
    data
  })
}

export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: '/v1_0/user'
  })
}
export const getProfile = () => {
  return request({
    method: 'get',
    url: '/v1_0/user/profile'
  })
}
/**
 * @description: 修改用户信息
 * @param {*} data  {name:'哈哈哈'}  {birthday:'2021-03-15'}
 * @return {*}
 */
export const updateUserInfo = data => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data
  })
}
export const updatePhoto = data => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data
  })
}
